home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / asm / cm_int.exe / CM-INT.DOC < prev    next >
Text File  |  1993-04-10  |  16KB  |  334 lines

  1.  
  2. ;------------------
  3. ;   CM-INT -- Interrupt Service by CMartin -- 2/22/92
  4. ;   Member ASP; CompuServe 72130,1400
  5. ;   The Program CM-INT is released as Freeware.  No contribution is expected.
  6. ;------------------
  7. ;   Intended as a tool kit for 80x86 Assembly Language programmers, this
  8. ;   service may also be useful to high level language programmers whose
  9. ;   language gives them access to the 80x86 interrupt architecture.
  10. ;   This interrupt service installs and stays resident, by including the
  11. ;   command CM-INT in autoexec.bat, and CM-INT.COM in root directory, or by
  12. ;   running CM-INT before any programs that use this interrupt service.
  13. ;   The functions in this service preserve the general purpose registers not
  14. ;   used for data transfer. They also preserve the segment, index and base
  15. ;   pointer registers.
  16. ;
  17. ;   This service is accessed via Int 0C0h, with function number passed through
  18. ;   bh. Description of each function follows:
  19. ;------------------
  20. ;
  21. ;   PAUSE
  22. ;       Function 00h: Pause until specific key is pressed.
  23. ;           Entry:  bl      - ASCII code of keypress required to
  24. ;                            release pause
  25. ;                   bh      - 00h
  26. ;           Return: None
  27. ;------------------
  28. ;
  29. ;   PRINT
  30. ;       Function 01h: Print string at current cursor position.
  31. ;           Entry:  ds:si   - pointer to ASCIIZ source string
  32. ;                   bh      - 01h
  33. ;           Return: None
  34. ;------------------
  35. ;
  36. ;   INPUT
  37. ;       Function 02h: Input a string from keyboard at current cursor position
  38. ;           Entry:  ds:si   - pointer to destination string
  39. ;                   bh      - 02h
  40. ;           Return: None
  41. ;------------------
  42. ;
  43. ;   SCAN (INPUT TO SCREEN) WITH PROMPT AND EDIT
  44. ;       Function 03h: Scan with prompt and editing at current cursor position
  45. ;           Entry:  ds:si   - pointer to ASCIIZ prompt string
  46. ;                   ds:di   - pointer to ASCIIZ destination string for
  47. ;                               data being entered/edited
  48. ;                   al      - data length - desired length of entry string
  49. ;                   ah      - data type -   0:no filtering
  50. ;                                           1:filter non-printable
  51. ;                                           2:numbers (0-9),blanks,and '+-'
  52. ;                                           3:numbers,blanks,and 'eE+-'
  53. ;                                           4:dates (0-9,'/-' and blank)
  54. ;                   bl      - 0=upper and lower case, >0=lower converted to
  55. ;                                  upper
  56. ;                   cl      - blank option- 0:no stripping
  57. ;                                           1:strip leading blanks
  58. ;                                           2:strip trailing blanks
  59. ;                                           3:strip both leading and trailing
  60. ;                   ch      - data window color (prompt field color is same
  61. ;                               backgnd as orig scrn attr, with hi intensity
  62. ;                               white foregnd. On exit, orig scrn attr are
  63. ;                               restored in all fields)
  64. ;                   bl      - 0:Upper and lower case; >0:Converts to upper
  65. ;                   bh      - 03h
  66. ;           Return: bl      - ASCII char code describing which keypress
  67. ;                               terminated data entry. A number of termination
  68. ;                               key combinations with corresponding codes are
  69. ;                               built in for versatility, and are all
  70. ;                               available. The returned byte ASCII character,
  71. ;                               the key combo that produces it, and the
  72. ;                               suggested usage follows:
  73. ;
  74. ;           'I'-<Ctrl><Rtn> {In}        'O'-<Ctrl><F10>-Delete block {Out}
  75. ;           'D'-Down arrow              'U'-Up arrow
  76. ;           'A'-<PgUp>                  'Z'-<PgDn>
  77. ;           'N'-<Ctrl>N-Insert New line 'Y'-<Ctrl>Y-Delete line
  78. ;           'L'-<Ctrl>L-Move Col Left   'R'-<Ctrl>R-Move Column Right
  79. ;           'C'-<Rtn> {Carriage}        'E'-<Esc>
  80. ;           'X'-Error - prompt plus data > 4 lines or off bottom of screen
  81. ;------------------
  82. ;
  83. ;   LINE PRINT
  84. ;       Function 04h: Print to parallel port printer
  85. ;           Entry:  ds:si   - pointer to string to be printed
  86. ;                   cx      - -1 means string is ASCIIZ and is to be printed
  87. ;                                   up to the terminal NULL
  88. ;                             Number other than -1 means print that number of
  89. ;                                   characters. (Permits 0 as a print control
  90. ;                                   character.)
  91. ;                   bh      - 04h
  92. ;           Returns: If print terminated by <Esc>, then leaves keypress in
  93. ;                             keyboard buffer, accessible by int 16h, func 1
  94. ;------------------
  95. ;
  96. ;   32-BIT NUMBER TO ASCIIZ
  97. ;       Function 06h: 32-bit binary number to ASCIIZ string
  98. ;           Entry:  dx:ax   - 32-bit signed binary number to be converted
  99. ;                   ds:si   - pointer to ASCIIZ destination string
  100. ;                   bl      - format for string:
  101. ;                               0=decimal,1=hex,2=octal,3=binary
  102. ;                   bh      - 03h
  103. ;           Returns: None
  104. ;------------------
  105. ;
  106. ;   ASCIIZ TO 32-BIT NUMBER
  107. ;       Function 07h: ASCIIZ string to 32-bit signed number
  108. ;           Operation:  Function scans from rightmost byte in string until
  109. ;                           beginning of field, ignoring illegal characters.
  110. ;                           Terminal h or H means hex;o or O octal; b or B bin
  111. ;           Entry:  ds:si   - pointer to ASCIIZ source string
  112. ;                   bh      - 04h
  113. ;           Returns: dx:ax  - 32-bit signed binary number  (0:0 for overflow)
  114. ;                    bl = 0 (normal return), -1 (overflow)
  115. ;------------------
  116. ;
  117. ;   JULIAN TO CALENDAR DATE
  118. ;       Function 10h: Convert julian date to calendar date.
  119. ;           Operation: Julian date is sent in on ax as unsigned 16-bit
  120. ;               binary number, where julian date 1=calendar date 1/1/1901.
  121. ;               Julian date <1 or >36525 (earlier that 1/1/1901 or later
  122. ;               that 12/31/2000 [12/31/00]) are illegal
  123. ;               Normalized calendar date (mm/dd/yy) is copied as ASCIIZ
  124. ;               string at the pointer provide by ds:si. If julian date
  125. ;               is in illegal range, the string '  /  /  ' is copied.
  126. ;               In addition, the day of the week is returned as a number
  127. ;               0-7 through bh (0=illegal,1=Sunday,etc.).The century
  128. ;               prefix (e.g., 19 for 1956) is passed through bl.
  129. ;           Entry:  bl      - century prefix
  130. ;                               (e.g., 19 is century prefix for 1978)
  131. ;                   ax      - julian date (unsigned 16-bit) (1=01/01/01)
  132. ;                   cx      - number of digits to display year (2 or 4),
  133. ;                               if century prefix is 19.
  134. ;                               (If century prefix not 19, 4 digits will be
  135. ;                               displayed, regardless of contents of cx)
  136. ;                   ds:si   - pointer to ASCIIZ destination string where
  137. ;                               calendar date is to be copied (11 bytes min)
  138. ;                   bh      - 10h
  139. ;           Return: ax      - julian date as unsigned 16-bit number
  140. ;                               (0 if illegal)
  141. ;                   bl      - century prefix
  142. ;                   bh      - day of week (0=illegal,1=Sunday,etc.)
  143. ;                   cx      - year (1980-2099)   (as expected by system set
  144. ;                   dh      - month (1-12)       date service int 21h, 2Bh)
  145. ;                   dl      - day (1-31)
  146. ;------------------
  147. ;
  148. ;   CALENDAR TO JULIAN DATE
  149. ;       Function 11h: Convert calendar date to julian date
  150. ;           Operation: Converse of Function 10h, except that calendar
  151. ;               date string is normalized to 9-byte or 11-byte ASCIIZ form
  152. ;               (mm/dd/yy+terminal NULL or mm/dd/yyyy+NULL, depending on
  153. ;               whe